<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<html>
<head>
    <title>登录页面</title>
    <link rel="stylesheet" type="text/css" href="/static/css/login.css" media="all"/>
    <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<div id="main" align="center"> <!-- align属性设置居中 -->
    <h2>用户登录</h2>
    <form id="loginbox" action="/login" method="post">
        <p>用户名: &nbsp;&nbsp;<input type="text" id="username" name="userName" style="width:150px"/></p>
        <p>密 &nbsp;&nbsp;码: &nbsp;&nbsp;<input type="password" id="password" name="password" style="width:150px"/></p>
        <p>
            <input id="submit" type="button" value="登录" name="submit"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="/user">新用户注册</a>
            <span id="message" style="color: red"></span>
        </p>
    </form>
</div>
<script type="application/javascript">
    $(document).ready(function () {
        $("#submit").click(function () {
            var username = $("#username").val();
            var password = $("#password").val();
            if (username == null || username == "") {
                $("#message").html("账号不能为空")
                return;
            }
            if (password == null || password == "") {
                $("#message").html("密码不能为空");
                return;
            }

        });
    })

</script>
</body>
</html>

